Work and bug fixes