Improved extract_mini.sh script