added a few casts.