Better do NOT apply the above mentioned tricks for getting rid of the error message. Rather, look for the reason of that problem.
Maybe, either you or the person whose project you're running have tampered with template scripts. When you are using the old A5 templates, make sure to use their original versions from the template folder, and not any copies or modified versions.
Otherwise there's a REMOVE keyword in your own code. Erase that and use the proper ent_remove function for removing entities.