Updated for compatibility with Glimmr and Flexible Windows