Fixed bug regarding .mat extension