Changes made as suggested by Luc Perkins and Dave Parfitt