Smoothed out some merging of client and worker. Fixed potential bug.