Fixed various syntax and compile time errors.