maze: Added support for -w and -f flags.