Hotfix 2 (V. 1.015)

Hotfix I applied to the main branch over two pushes. Contains serious
security issues fixes and some non-serious but still important bug
fixes.