Fix javascript inheritance