Updated .tew file reading