Bug correction and test code removal