Why is this forest buggy?:

I cant posts the bugs, the bugs are:
-Disappearing of solid entities and the terrain.
-Non dissapearing the same entities and terrain when player is too far away.

My code:

http://xw2.rf.gd/ambient%20light%20update/
view-source:http://xw2.rf.gd/ambient%20light%20update/

Can yous repair it?

I catched a bug: