Fix a failing ruby unit test and minor fixes