Queue stuff and minor fixes