fix for #322

Fixes #322.  Thanks @gidden!