Fix for the Model toArray method