Fixed some code analysis problems and lowered target framework