Clean up legacy code related to undefined aliases
Improve error reporting by not printing the stacktrace of normal errors