Fixed library names for current CULA and added error checking to produce sensible errors.