Changed a reference to cend() to end()