Changes to fix issues 1-4