Trivial fixes.

Fixed Possible NPE
Cleaned up some empty lines
Simplified for loop