various fixes and rendering robustness improvements.