Fix scope in prelink function