Compiler warnings

Fixes several "possible assignment" compiler warnings and the gtest warnings