Fixed a class cast exception.
Merge pull request #1 from cshipley/fix_class_cast_exception

Fixed a class cast exception.