Fix error message, max values in window and save of deleted portfolios