Fixed issues raised in @ploeh pull request review