Fix assorted errors in client script