Added DER signatures, made some bug fixes