Add static cast for shared_ptr -> bool.
Merge branch 'tickets/DM-1302'