some painful and ugly startup fixes