gi: Fix some annotations and docstrings