Fix #507 clang compilation error in layer_io.cpp