Oil gains as U.S. dollar eases though demand fears linger