Fixed a bug causing the transferring of incorrect capabilities