Fixing test compilation and some warnings