Fix some lint and reference errors