Update ripple-lib and fix resulting bugs

Please try to weed these kind of changes out before doing a pull request.