Real fix for bug #3
More fixes for bug #3