Add exit and err traps