Bug fixes and new options