Bug in model creation