Stable release

Old code left behind casting to wrong class.
Fixes issue #6