Fix scala inheritance