fix issues as reported by Fabrice

Change-Id: I60e1fedce5f2bf59944deb61059b3bf6c5ff1140