Add auto keyword and fix tests