Fix bugs

Fix compilation on newer Ubuntu
Fix passing uninitialized values to accept()
Fix wrong allocation size for mapper results
Fix double free()