Make SQLibrary optional.
Added events.