Fixed lerp function