Pull request for #140

I think I may have messed up with my multiple repositories and got 2 pull requests for the same issue. I hope this doesn't break anything. I recommend merging this one first.