Fixed build issues in samples, plus cleanup