Fix attributes loading order
Add event tests