Fixed syntax and compile errors