improve GC handling (fixes #10)
standardize OpenSSL return handling