Improved client logic.
Fine tuned constants.
Merge branch 'master' into better-client

Fine tuned constants.