Bugfix and test for https://github.com/vadimtsushko/objectory/issues/52