Fix #131

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

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