Add test cases for bug #494

The issues raised in bug #494 are no longer there but let's add some
test cases.