Test specifically for None to avoid ambiguous truth value of ndarray