Bunch of minor things

+ Removed some undeeded curly braces from objects
+ First stab at proper error codes