Fix for #17

@datakurre can you have a look at this PR ?