Fixed chunk loading problem along with other optimizations