Bug in u and v functions