Improve how used attributes are dealt with and remove shapes lacking essential attributes