Bunch of bug fixes, added thermal expansion api