Fix null location bug