Bug fixes in facts import