Hopefully fixing #339 (ClosedChannelException on portal)