Change empty location check to include nil