Events and files tests bugfixes