A few more tweaks to scala port

A few more minor cleanups and improvements on the scala port.