Fixed min/max and added multi-file support