small fixes in ranking calculation and Notification sending