Some null checks and cleanup