Fixed warnings pointed out by Sami Farin