Added http/https check when linking remote file
Fixed wrong function referencing