Fix removeAt bug

Thanks to David Moshal for finding