correcting some minor bugs