fix two outstanding bugs