more queue stuff and fixed unit tests