Added checking for existing and writable download directory, small fixes