add prefix checking to all scripts, various other changes