Improved setProperty method implementation in Model class.