WIP: fix issue #629