Added some tests for a sample and sanity check.

Fixed core logic with array remove so we keep things cleaned up.