Added logical check in VecmathUtils