Fixing bugs in model import