Minn. refinery seeks OK for $400M upgrade