diff --git a/ci/container/Dockerfile b/ci/container/Dockerfile
index fd0087886fe7e91d9c13dc7058fd34c14b8ed996..0c6c2a54f5dbc53d5a8f9fef05aaba8f4c5b16ea 100644
--- a/ci/container/Dockerfile
+++ b/ci/container/Dockerfile
@@ -10,5 +10,5 @@ RUN go get golang.org/x/tools/cmd/stringer
 RUN go get golang.org/x/lint/golint
 RUN go get github.com/agnivade/wasmbrowsertest
 
-RUN npm install -g prettier
-RUN npm install -g netlify-cli
+RUN npm --unsafe-perm=true install -g prettier
+RUN npm --unsafe-perm=true install -g netlify-cli
diff --git a/conn_notjs.go b/conn_notjs.go
index bb2eb22f7dbad0e22a5b932fbbab50f7381c64ce..0c85ab7711b14a653cc207dca018a4cc5cc4a4d2 100644
--- a/conn_notjs.go
+++ b/conn_notjs.go
@@ -189,7 +189,7 @@ func (c *Conn) Ping(ctx context.Context) error {
 }
 
 func (c *Conn) ping(ctx context.Context, p string) error {
-	pong := make(chan struct{})
+	pong := make(chan struct{}, 1)
 
 	c.activePingsMu.Lock()
 	c.activePings[p] = pong
diff --git a/read.go b/read.go
index afd08cc7cdebccceabed33ac547e68211c0e8b69..ae05cf93eda93860cc77fe9ed48c9cc9de206c9e 100644
--- a/read.go
+++ b/read.go
@@ -271,7 +271,10 @@ func (c *Conn) handleControl(ctx context.Context, h header) (err error) {
 		pong, ok := c.activePings[string(b)]
 		c.activePingsMu.Unlock()
 		if ok {
-			close(pong)
+			select {
+			case pong <- struct{}{}:
+			default:
+			}
 		}
 		return nil
 	}