Fixes #408

Includes the features mentioned in the comment for #408
The parameter looks like it hadn't been used for a while.