Add auto slot count adjustment. Fixes #1.