Improved version suggested by Marcus.

Signed-off-by: Matt Benjamin <matt@linuxbox.com>