Fix capacity calculation