Fix version cache bug and overall cleanup