Fixed compile errors & warnings