Fixing bug in rendering selection fragments