Various bug fixes to pass tests.
All 88 waterline tests pass.