Issue 24

This should fix issues #24 and #23 at last! :beers: 

@zupo or someone else, please check it in case I missed something...