Pr/36

Added fixes to @jden pr #36 and pushed as a branch, merging this way, deal with it :P