minor fixes from hrjones-2