Fix #371

Signed-off-by: Clement Escoffier <clement.escoffier@gmail.com>
Fix #372

Signed-off-by: Clement Escoffier <clement.escoffier@gmail.com>