Make rehash give a little more feedback, improve usage a little and add a security check to it.  Also tweaked related functions usage.