WIP
Cleanup
Small fix and style
Formatting
Small optimization
Merge pull request #12 from meriouma/mmc_generics

Fixed a bug that happens in some cases with generics