Formatting and Correctness

Fixed some code-formatting issues and a small bug.