Fix #3: filename's dir is not used when saving