Fixed open from file, and remove file functions.