Fixed critical bug #39 . See bug report for more details