Audit log fixes

Coming from Ondra Lukas's tests.