Merge pull request #4554 from kumpera/cleanup-random-stuff