Fixed some totally lame bugs