Attempt to reduce memory leaks, format overlay