Libcusmm: restored error handling