Plug various memory leaks in core.c
Add better error handling in core.c for MRI
Update history file