Fixed decoupling crash

Fixed a crash that occurred when attempting to decouple under certain
situations