Refactoring bug fix

Signed-off-by: Benjamin Mosnier <bm@kappuccino.org>