Fixed errors, added bouncy castle