fixed some bugs (according to IDE)
These snippets were marked as erroneous.