* modified error handling on failed downloads
* various cmake changes and fixes