Changes for saving a binary file