Fixed directory saving bugs.