Fix seralization of boolean type

This fixes the serialization problem when specifying arguments like use_has_next=True