Added test for issue 345. Fixes #345. Fixes #336
removed incorrect test