fixed small algorithmic troubles
Merge branch 'master' of github.com:srct/advisor