Complementary fix for issue #157. Need more tests!