cleanup queue.put, add some tests