Minor X-platform improvements and a bit of debug