Fixed scala + java impl