Add checks in om_util.

 * Add checks in om_util.c to prevent possible segfaults.