Fix a Ruby 2.1 segfault issue, and add more method documentation