Changes suggested by calum for PR #44.