model: some bug fixes to the model checker