fix some bugs found during testing
Merge branch 'develop' of http://github.com/jiangkuo888/ORP_beta into develop