Fixed SWAP_POINTERS to use type