Remove debug. Fixes for timeout handling and calculation. Update documentation
in file.