Fixed problem with AttributesSet.getAttribuesCount() = -1. TODO: handle dimens