fixed some segfaults, as well as removing from queue errors