Fixed bug in models