fixes for pull request

Commits:
af65fa91a77e7b0d24be4e00780961018f602737
bbcd0def876b7596289289b877c6312aad826209
90b1c841f0527975a28642a3704f3e1e4c5419cf
0c3ecae8d3861008543f2fb09fcf4c68897c697f

Removed useless compiler flags.
Fixed code faults.