Added more null checks.