More const correctness and fix shared attributes