Fixed errors for saveFileAs method