Carp  fix queues and tests v2

Pull request second time. Fixed stuff based on comments.