Add "source" stat, some bugs fixed, back-up before refactoring

Pre 1.4.0