Some minor changes

add option polys to minpoly
change order of and operands
Add tests for minpoly