work on #541
tests for #541