Some framebuffer-related fixes