I have the same issue with my S4, but Josh's method unfortunately didn't work for me.
This is what I did for about 10 times now.
I went into the recovery mode. Selected the wipe data/factory reset option. Selected Yes. It said Formatting data, then formatting cache and said data wipe...