Add test case to cover #676

Fixes #676