Corrected some minor bugs.