Minor fixes to min()/max() and tuples

Relatively minor fixes to min()/max() to handle more types and error cases correctly.

Check type in tuple concatenate to ensure only tuples are concatenated with each other.