Minor changes and a NPE fix.