Fixed small bug - gather metadata function definition.