Fixed most compile errors.
Compiling, finally.