Added some fixes. Should be checked...