Added fixes as recommended by Bill Reiss