Imported changes from autotools