Added sparse support for monomial orders and fixed minor bugs