[BUGFIX] Fix Query unit test and two typehints