Fix double end()