undo regression of d8d9fa62, fixes #1645