Fix a bug in getMessages. Add new exceptions accoring to protocol.