Portback part change of enabling F821 check

Enable F821 and fix usage of undefined variables.

Change-Id: I0d5104060410986df4b83a3e9e865365004d0313
Signed-off-by: Zhi Yan Liu <zhiyanl@cn.ibm.com>