Various bug fix and logging improvement.
Authored by: brunoherbelin 2015-12-19
Parent: [r1074]
Child: [r1076]