Now, it will also check for equality of first and last activity and proceed accordingly.
Authored by: agarwalamit 2014-11-21
Parent: [r31160]
Child: [r31162]