Fixed a few bugs so caching and test examples worked, files is TBD