fix for first display of sparklines and better error messages and id checking