Move to bouncy castle 1.50 removing deprecated calls.
Minor bug fixes