Various fixes which are required for gp2c, but which do not otherwise change the functionality of these scripts.
CC: @JohnCremona
Component: misc
Author: Jeroen Demeyer
Branch/Commit: a6e0513
Reviewer: Volker Braun
Issue created by migration from https://trac.sagemath.org/ticket/18874