bugfix, make tests pass