Corrected annoying bugs