Cleanup and stability improvements.