Random fixes

 * Change pattern test for pgp data to be more correct
 * Instantiate ctx object once
 * Use custom exception to pass onto next method