Fixed bugs with single command input validation, fixed initialization errors in MessageLoop, fixed addAfter/addBefore/replaceCurrent.