tests and a tiny bug fix