BugFix on attr

With help from Marco,
http://rapid-i.com/rapidforum/index.php/topic,7937.0.html