code check and test fixes