Solution to problem 6
Fix some warnings