fixed syntax bugs. OSX older than 10.7 currently broken