fix warnings and small performances improvement

Laurent requested to merge perfs_and_warnings into master

Merge request reports