couple fixes and cache improvements