Cleaned up casting.