Fix for bug reported by Lipu