Added role='button' to button elements
More robust handling of null and undefined.