Bug fix v6r7

Exit with code -1 in case of error
(To be applied also to v6r8 and integration)