Problem fixed by avoiding wildly casting IP Address from String to Int to IPv4Address to Long and back again.