Removed many casts that appear to now be unnecessary