Fixed integer math causing domain error.