minor bug cleanup to make tests pass