Fix compiler warnings

Also enable more warnings with "-Wall".