Modified to handle being run via sbt.