TESTS: added regression tests for #563 and #564.