Avoid reflections

Added a couple of type hints to avoid reflections.

Signed-off-by: Gergely Nagy <algernon@balabit.hu>