Merging the last commits for making reemc simulation work