auth support, lots of bug fixes