Scala tweaks. Closes #432, #462.