tests for #496
fix #496
more tests for #496
remove superfluous prints