more bug fixes
Most tests pass, yey