Fix module name handling in `--main`

Not sure how I missed this originally, it was obviously completely
wrong!