Fixed a bug in pocket-making.