Fix bug in clear
Various fixes
Queue replacement works sometimes
Queue creation with replacement finally working right