Fix for issue #8, corresponding to issue #22 in pm.

@JnBrymn