changes to proc_cleanup and locks
preliminary fork