Fixes #3 and bumps version to 0.5.1