Fix invalid request when using both dynamic and custom headers

close #218
Remove incorrect imports

close #219