fix bugs in WProto and WMessage