Fix for scalar conversion errors