Fixed OnMessage bug; Added -n option on the command line