Fixed issue where total balance function is called even when there is no patient chart active.