Review changes to be squashed

Fix error handling (Discovered this myself)
Add check for the last fsync error