Fixed formatting issues and bugs.