A few more tweaks to scala port