Changed the switch from string to int (java 1.6 compat)
Fixed some stuff