Fixed a bug in loadText where the file lock wasn't released