Bug correction and test