Fix two small bugs related to #25

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

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