Replaced MP state machine with preprocessor version.