Fix ruby warnings

Here's a patch that fixes some Ruby warnings when executed with -w RUBYOPT.