fix dumb copy/paste
code analysis and test fixes