Make main script safe for symlinking