Add relative support and tidy things up