Fixed bugs from previous commit, should compile correctly now