Fixed issue with cookies, when headers are sent.