Minor bug fixes and turn off debugging mode