Fixing process creationg and exit related functionality

exit() and wait() should work perfectly after this commit