"Resource unavailable"-bug fixed. Caused by printing too many output on unbuffered stdout.