Remove unused code.
Fix gpx initialization.
Extract read timeouts into variable.
Replace cout() by proper log calls.