Fix annoying warnings and provide an optimization.