Apparently the linking problem was related to group materials. After experimenting with diffent settings, it works fine now.