Fix bugs in meta_data_layer.cpp.