Apply various bug fixes
Merge branch 'develop' of ssh://illarion.org:1010/scripts into develop