More improvements from Aaron S. Hawley <ashawley@sourceforge.net>