Attempt to fix some bugs

Allows crypto to compile under unittest but still not link