Add more error checking to l_register_ore