Fixing errors in the routine module