Fixed a few bugs with queues, final commit before testing