Fix the Monoid and Semigroup instances (Close issue #15)