Make attribute binding more robust

Fixes Cannot read property ‘match’ of null errors for attributes will
null values