Fix TypeError in cleanup_subject() when subjecct is None.