Fix some small logic in worker