fix several small bugs

trivial
@lennartcl