Attempting to troubleshoot script errors