Bug fix in models