Changed static_cast to a dynamic_cast like it should be. Surprisingly it doesn't crash under linux.
Prepare for a new release.