Fix one compile error and several warnings