Fix for Ruby > 1.8

This fixes ruinput for Rubies > 1.8. Also, 'release_all_keys' seemed to be missing.