Add null checks for statements