Fix for issue #73.

I am not 100% sure of this fix since I am not a ruby developer - but it did work fine on my setup. It is based on this SO answer: http://stackoverflow.com/a/10015707/15695.