Fix for Q cast