Fix bipolar cavity ambient medium

Also includes a fix to make ``get_quantities`` accept input files.