Updated protocol in simulator. Fixed some minor bugs.