Replace deprecated boost pointer casts