On Effective Superpotentials and Compactification to Three Dimensions