MS Code Analysis fixes