This reverts commit 125146ebd2 because of the solution for bug #1320 was causing a new bug #1540.
125146ebd2