Updates

Added integrity check. Fixed other stuff.