Better cleanup handling and fixed worker use