Minor fixes to autobuild function.