Fix deprecation issues.

The 'val' in the for comprehension is unneeded and deprecated, so I removed it.
'Integer' is deprecated - I've switched to the Scala specific Int, which can
never be null