Fixed various small bugs and got the code compiling again