Fix runtime exceptions, add support for referencing the root directory in links, fix issue with an extra file extension and / in file paths