Fix scaleFactor() not return default scale if invalid

Got the commit to only contain the changes I want to contribute. Looks like you have set your linebreak to CRLF (i.e. Windows), whereas I am on OS X so my linebreak is LF only.