Changes for netty 4.0 and minor fixes