Tests for #377

It seems that #377 has already been fixed.

Nevertheless, tests for it where missing.