Added custom type to config.
For future, to allow custom commands easily.
Changed visibility of some methods, added close().