WIP Fixing bugs to get tests passing again.