Add extra type protection to library.
Change result checking for GqlCommandDatabase class.