fixed a bug when G and h were None in Python