Make it compile and remove warnings