bugfix: removed del before some functions.
Some various bugfixes.