Hotfix - small changes to improve code (from my comments on commits)