Fix all of the compilation issues. Need tests