Use versioned libs
Fixed poor handling of errors on exit handler