Fixed some bugs
Fixed some bugs

* Fixed undefined behaviour
* Fixed compression failure

zackp30/cuberite,zackp30/cuberite,birkett/cuberite,Tri125/MCServer,tonibm19/cuberite,jammet/MCServer,QUSpilPrgm/cuberite,bendl/cuberite,Frownigami1/cuberite,Haxi52/cuberite,kevinr/cuberite,nounoursheureux/MCServer,bendl/cuberite,nevercast/cuberite,jammet/MCServer,johnsoch/cuberite,bendl/cuberite,mmdk95/cuberite,guijun/MCServer,linnemannr/MCServer,kevinr/cuberite,marvinkopf/cuberite,Frownigami1/cuberite,johnsoch/cuberite,nevercast/cuberite,thetaeo/cuberite,Howaner/MCServer,thetaeo/cuberite,SamOatesPlugins/cuberite,zackp30/cuberite,johnsoch/cuberite,Schwertspize/cuberite,mmdk95/cuberite,electromatter/cuberite,Howaner/MCServer,nichwall/cuberite,mjssw/cuberite,Frownigami1/cuberite,Tri125/MCServer,marvinkopf/cuberite,nounoursheureux/MCServer,electromatter/cuberite,Schwertspize/cuberite,electromatter/cuberite,johnsoch/cuberite,nounoursheureux/MCServer,birkett/MCServer,mc-server/MCServer,QUSpilPrgm/cuberite,Fighter19/cuberite,mmdk95/cuberite,ionux/MCServer,kevinr/cuberite,ionux/MCServer,mjssw/cuberite,linnemannr/MCServer,nicodinh/cuberite,Fighter19/cuberite,Haxi52/cuberite,mjssw/cuberite,guijun/MCServer,zackp30/cuberite,mc-server/MCServer,HelenaKitty/EbooMC,jammet/MCServer,Fighter19/cuberite,mc-server/MCServer,jammet/MCServer,Altenius/cuberite,Fighter19/cuberite,nevercast/cuberite,Haxi52/cuberite,marvinkopf/cuberite,linnemannr/MCServer,birkett/MCServer,ionux/MCServer,nounoursheureux/MCServer,nicodinh/cuberite,QUSpilPrgm/cuberite,HelenaKitty/EbooMC,bendl/cuberite,Altenius/cuberite,Howaner/MCServer,nichwall/cuberite,bendl/cuberite,nichwall/cuberite,jammet/MCServer,guijun/MCServer,SamOatesPlugins/cuberite,Howaner/MCServer,guijun/MCServer,electromatter/cuberite,mjssw/cuberite,Fighter19/cuberite,nichwall/cuberite,nichwall/cuberite,nicodinh/cuberite,ionux/MCServer,SamOatesPlugins/cuberite,thetaeo/cuberite,jammet/MCServer,electromatter/cuberite,nevercast/cuberite,Tri125/MCServer,mc-server/MCServer,linnemannr/MCServer,linnemannr/MCServer,Haxi52/cuberite,Haxi52/cuberite,Howaner/MCServer,guijun/MCServer,Altenius/cuberite,nounoursheureux/MCServer,birkett/MCServer,mc-server/MCServer,birkett/cuberite,marvinkopf/cuberite,birkett/cuberite,kevinr/cuberite,guijun/MCServer,thetaeo/cuberite,ionux/MCServer,zackp30/cuberite,Frownigami1/cuberite,zackp30/cuberite,birkett/cuberite,mmdk95/cuberite,mmdk95/cuberite,birkett/cuberite,tonibm19/cuberite,tonibm19/cuberite,johnsoch/cuberite,mmdk95/cuberite,QUSpilPrgm/cuberite,linnemannr/MCServer,HelenaKitty/EbooMC,nevercast/cuberite,Tri125/MCServer,Schwertspize/cuberite,SamOatesPlugins/cuberite,kevinr/cuberite,Altenius/cuberite,mc-server/MCServer,birkett/MCServer,nounoursheureux/MCServer,nicodinh/cuberite,nevercast/cuberite,Howaner/MCServer,marvinkopf/cuberite,Fighter19/cuberite,Tri125/MCServer,birkett/cuberite,Schwertspize/cuberite,HelenaKitty/EbooMC,QUSpilPrgm/cuberite,mjssw/cuberite,Frownigami1/cuberite,QUSpilPrgm/cuberite,tonibm19/cuberite,tonibm19/cuberite,electromatter/cuberite,nicodinh/cuberite,birkett/MCServer,SamOatesPlugins/cuberite,mjssw/cuberite,tonibm19/cuberite,HelenaKitty/EbooMC,Schwertspize/cuberite,thetaeo/cuberite,ionux/MCServer,birkett/MCServer,nichwall/cuberite,Altenius/cuberite,Tri125/MCServer,Haxi52/cuberite,marvinkopf/cuberite,nicodinh/cuberite,thetaeo/cuberite,kevinr/cuberite