changed behavior of scala generator main to fix bug #44