Closes #769. Also fixes an error when adding missing '.' to mapped extensions. The previous behavior tried to access a value after it was removed from the dictionary.