Fixed some issues with setting headers and post fields