fix JSHint-detected flaws, prettify the output