Ensure fieldCount is a String and then use Long.valueOf instead of cast
to Long.