Fix a bug when passing a block as job