patch from kseistrup fixes #1