Fixed an inconsistency in internal procedure code