Added check for POD type in templatized read/write function.