Fix save function to validate filename properly.