Adding old hacks (not included into 1.3.6) into release-1.3 branch