Added compatibility for .mat files