Fixed equation errors and other changes