Fixing some issues reported by Mark Jansen during a pull request review