Add new corner cases

Add some new corner cases. These exposed problems in the Ruby implementation which have now been fixed.