final bug fixes and tuning