Stronger session IDs, misc fixs