Corrected DO-Problem in procedures and functions