Bugfix: Use central file write method