Small improvement to isSafeMove condition