Corrected base changing bug