Fixed two bugs

Bug 1) Divide by 0
Bug 2) Issue where the cost would be almost 4 times intended cost if
the seconds elapsed was 0 or 1