fixes for issues Andrey raised