Added missing semicolons
Fixed array/object casting issues
Changed tabs to two spaces