Fixing symlink creation

@Anahkiasen this is a big one. Review it, but I think it's a good patch. If you don't understand something I did, feel free to ask!