Warning fixes and small improvements.