Few fixes for bugs discovered during testing.
This will create a new commit in order to revert the existing changes.