Fix issues preventing usage gem

The latest code was not able to run due to some simple issues. I've fixed these issues and the gem works again.