Fixed typo in array key.
Added type hints for variables.