RF: use np.asanyarray for simpler code
RF: simplified code as suggested by yoh in PR #164