Fix type hinting for Serializer