[1.2.5] Fix issues with beanstalkd

  * Fix #1348
  * Fix #1612