Fixed problems with HTTP requests not downloading fully (closes #562)