Added error checking for OBJ_create