compiles!

Fixed some bugs so that the patch actually compiles! Not yet tested, since I'm not sure how to build the plugin-jar for AppCode