Bug fixes for loading from text