Added pre- and post-balance checking

Also fixed apart balancing