Oil gains as US dollar eases though demand fears linger