use urllib to allow relative path and some  trivial fixes