fixed a few bugs caused by the merge with develop
Merge branch 'bugFixforDevelop' into develop