Fix problem with masterfile creation