Fixed issue where certain types of links would cause code to fail