Error handling and timeout issues solved thanks to Ulf Haase.