Reflow the code to move error handling to the end of the functions. Initialize gvalue like we do in the setter. Add a unit-test module with two simple tests the catche this bug.