Fixed Double to Long cast bug