Fixed heap usage and made program compile on OS X