some scala fixes