Optimize and fix build on VS980

Change-Id: I2b0190a2a94e538e728c22e80529a7a30f7cd362