Fixes for stable version, making it compatible with stonesense overlay.
Unfortunately the other branches are incompatible in different ways.