Address issues brought up by Scala compile time warnings.

This fixes issues that cause compile time warnings.