had reference problem with already loaded files. added better support for
file extensions.