Bug fixes, updated delegate, cleanup