Fix compilation and hlint warnings.