Fixed profit calculation. Fixed unit tests.