Fixed a bug with checking captured pieces