Added patch from #2393 and reorganized some files.