Load library and check for correct return code