Fixing some bugs and improving netty