Switch from Monoid to Semigroup
Fix some warnings
Minor indentation cleanup