Added some debug stuff

Hopefully this will be useful in tracking down dimension/rendermode
issues