Fixing syntax and dead objects