On OSX, check for EOF before file stream errors
Use a read/write mode when deploying standalone files
Use the correct check when skipping spaces between words
Check the type of ValueRef when importing HTML text