Fix bug and make style the output to look better.