Made atomic work even before the first SQL query.

Thanks Florian for reporting this bug.