Fix a coding issue involving a Fibonacci sequence.
Asked in the Technical Round stage as a live coding and debugging prompt. Implement the corrected function using zero-based indexing: fibonacci(0) = 0, fibonacci(1) = 1, and fibonacci(n) = fibonacci(n - 1) + fibonacci(n - 2) for n > 1.
n is a non-negative integer. Return the nth Fibonacci number as an integer.
def fibonacci(n):