Corrected some minor bugs and formatting