Removed some unnecessary casting.