More checks in query and use more eprintf()