Fix bug #5636