Add safeCast instance for Double to Int