Fix small bugs and warnings.