Fix ADD max_dim check in protobuf parsing