Replace pointless null checks