Fixed issue where writing instances required also contents number for cunk calcualtion (this code was removed mistakenly on prev commit)