Fixed test errors introduced yesterday

Tests still fail as database structure has changes and I can't be
bothered to changes tests