Fix crash and duplicated work
Merge pull request #1 from toastedcornflakes/master

Fix crash and remove duplicated work