Fix for duplicate callback bug, issues #16 and #29
Fix syntax, redundant property declaration and block scoping errors