Bug fix: didn't cache properly when using multiple targets.