Fixed some bugs. Compiles properly now.