Fixes for gridstore close returning the gridstore object, added test #938