Enhance dynamic type to allow downcasting - Fixes #7