Fixed some code up