gp.py: error checks