Small fixes to secure integrity of data