Fix small bugs in security library. Sign/verify is not working yet.