The implementation of AST's in Spirit.Classic is known to be slow and buggy at times. You should consider switching to the new version!