Fixed the annoying iterator bug, now it's free of critical problems.

Also optimization, and cleaning of additional libraries.