yes, crancase sensor,gives spark signal to engine, till it goes wrong. (behind pulley at back of engine). 1 x 900 i had did the same, it started to misfire occasionally and check engine light flicked on for a split second then later started to die as soon as the engine got a bit of temprature and then misfired like f---. put 2nd hand one in no problem till that one went, but this time it just died and that was it, put another 2nd hand one in ran till sold.
there is a similar thread problem about 2-3 days ago.