Hardening of selection algorithms and wrote respective unit tests.