#1097 fixed #1077 but introduced another issue, reverting to find a fix that does not cause this problem.