Test fixes and removal of old code.