Fix OutOfBound exception in swapoutOrphanBlocks
Unit test for swapoutOrphanBlocks
remove tailing whitespaces
Merge pull request #96 from GraceH/swapoutOrphansfix

Fix OutOfBound exception in swapoutOrphanBlocks