Cleanup and validation fix