Adds missing throw error calls.