merged fixes from Scott Rubin