Removed the hack where I was writing the admin tenant id to disk, this was being used by another project to get the admin tenant id and is no longer required to be done here.
Changed the default value for the 'cache' setting to 'false', cache was just causing too many problems to leave it on by default. Will investigate more later.