variable use with the previous patch was causing writes to a file with an incorrect name, as discovered by mlarkin@. Thrashed out with / ok jca@.