Some bug fixes for couchqueue