Fixing possible ClassCastException if version is an integer number