Few improvements and fixes

Hi,

I have integrated cash-on-delivery in my project.
During the process I have came across few minor bugs. I have fixed them and have done few other improvements as well. I would really appreciate your review of the changes.

Thanks,
Lijo