Patch from Scott McKellar which introduces a const-accepting and -returning