Changed to use 'auto' as many as possible.