Change autoclass to autoexception

Fixes #1388 or part thereof.