Fix calls to idle() function
Replace malloc.h with stdlib.h