Fixing prototype-based inheritance