Fix for bug reported by dkharrat