Patch #5384 from Alexander Spyridakis - fixes bug report 4908