Suggested fix to broken attr behaviour

This is my fix for the bug/inconsistency mentioned in https://github.com/bitovi/canjs/issues/667