Fixed database checking against non-existent tokens.