Added some TODOs.
Corrected errcode.
Improved delay estimating.