fix compilation of am scalar test with MSVC + remove unreachable code