Update ui directory functions with null checks; change html5 shiv code to use ui directory function