Fixed a few other cases of incorrect selections
Added unit tests