Fixed public key algorithms, Math module, and refactored Vector