Fixed parseAttribute method

See code comments in commit