Minor updates to support relative paths

Thanks for the code!  Here are a few tweaks I needed to make it work in a subdirectory of public_html.