Fixed some scala warnings in core.