fixed the bugs according to Yosef's review on OpenPTV/openptv pull request #24 remarks

see the review and replies on https://github.com/OpenPTV/openptv/pull/24