Fixed some control bugs