Added autoinit option and other minor features