Implements some suggestions from AutoScript