Updated spec and added safe free()