Fixes #859 - bad error messages when showing source of main methods