Ruby 2.0 compatibility and better error messages