fixed corruption & other various updates
Merge pull request #22 from johanjusits/branch-1

fixed corruption & other various updates