Fixing bugs for newer Ruby
some specs too