fixes based on comments by Neil Hainer