Many Fixes for Unit Caching Script