Fixed some errors
Fixed some compilation errors and ran local tests on code.