More plugin fixes for undefined variable cases