Fixed bug that gave fatal error if the directory didn't exist.