fixed bug derived_code not being passed to models!