fixes zero-length filename glitch
validates output
nicer handling of YY_FATAL_ERROR