Fixed vector and theta calculation.