Fixing JS OOP problems