Fixed some sorting issue

Issue at compareTo method in Task Class.