Fix get_metadata template tag for setting variable to global context