Revert "Fixed up some code errors"

This reverts commit 9e124293e413863c5e56be530008e2808eb88200.
Fixed some more suff. I think its working now