Cleanup various methods
Improve [max|min]With check
Merge pull request #105 from megawac/cleanup

Cleanup