fix bug in get_size, which may fail pull request