Fixed a bug in separate calculation