Fixed nullpointer exception

Fixed nullpointer exception when using the TPFGA.