bug fix and test fix; (thanks Martin Garton)
typo fix