fix issues introduced by pull request #22 and bug with formatter

fix issues introduced by pull request #22 and bug with formatter