Bunch of bugfixes - mostly working homogenization and expansion