Add GF tests and fix GF bugs