Fix compilation, change rpl_malloc detection, closes #423