Fix a bug in machine creation