fix #130

Here's a solution. Hope I'm not to far off your coding conventions :)

Just to be sure... what line endings do you use? I was getting some warnings. This pull request has LF line endings though, it seems to be right?