bugfixes & framebuffer sorting