A better fix for bug #4625

Signed-off-by: Madhura Jayaratne <madhura.cj@gmail.com>