Issue #28: My fix. Should close if tests ok.