Implement min and fix toString bug on digit