Implement changes from Matt Flowers.