fix nif loading