I would also be wary of the engine,its not the best unit and your emission fails are typical of one with little or no oil,at below minimum when hot they(and the mini derivatives using the same unit)suffer oil degradation/starvation which affects the vvt unit and valve hydraulics leading to misfires/high co etc.no way of telling anything for certain from this end of a fail tho,it could be perfectly fine but get it checked soonest