Fix threading arguments bug

Add a test to for spawn and Queue functions