Add prototype, fix parameter passing bug.