Fixed bug in prepareModel for DoP