Fixing compile error with fork in main