Corrected minor bugs