Fix for casting