Fixed None checking