Added more formatting tests.
Code review comments by Nawaz on StackOverflow.