Several minor fixes before going live with this code.