Fixed window rendering and some other issues.