Issue #509 - add tests