minor bug fixes and add a default format type