Minor edits to original pull request from @capezzbr and @dkhamsing