capacity(int) tests & bug fixes