Fixed NullPointerException on incorrect or missing attribute.