More fixes on bugs and scaling