Tons of syntax fixes and at least a bugfix
A couple of more bug fixes
Merge pull request #1 from dvaleriani/master

FIX: a couple of bug and syntax fixes.