Fix problem with pattern match to record.

This is the correct way to ensure that the item passed to a function is of the desired record type. I will make a change to the book text to match this.