ECDR-32: Updated tests and cleaned up code.