Solving Runtime errors

@ABG: Thank you very much. These are extremely valuable comments. I appreciate your time.