last bugfixes

Now it is ready for final testing