Removing test code.
Fixing issue with checking if pending or latest exists.