Added handling of the "Location" header.

Added error handling.