Big bug fixes related to cleaned up core api.