This seems to be a more stable way to discover the root directory of webwork. For some reason $ENV{WEBWORK_ROOT} is occasionally undefined.
Changed paths: