Null reference fixes.