Changes to fix bug #303