bugfixes and enabling correct arch detection.