Added dtor. Reordered members for dtor.	Fixed scheduler_loop().