Properly defer error recovery functions.

recover() must be inline to the panicking func otherwise
it will always return nil.