Fix compiler errors & warnings