More const correctness, fix crash with atlas