Fix minor errors in layer.hpp and blob.cpp to implememt ToFile function.