Fix sample building bugs.