Fixed map writing

Added new arguments to specify whether user wants a map file or not.