Remove logs and prevents NPEs.