Fixed wrong category link handling, closes #934