Fixing linking logic