Replace 'unneeded code', added additional tests.