Fixed bugs in netlock.c
Modified netlock.c