Fixes for the ESO-APEX query tool

There are some outstanding bugs in ESO though, some introduced by me.