Upgrade to published gem version & fix minor issues

This pull request contains the code published on rubygems.org.

It also fixes a few minor issues (see commit comments).