fix bugs related to indirect upvalues