Issue 463: Chaned code by following Marta's feedback.