Preventing Prelude.head pattern matching error.