OnAccountScan uses Metadata now, minor errors fixed