Fixes #20 - Array index out of bounds when there is no record.
Fixes #19 : Fixed IllegalArgumentException which was caused by dividebyzero :-]