changed from float to double to avoid losing precision (and avoid a warning)
added a null check, otherwise it can crash when loading an empty file
Merge pull request #19 from SmilyOrg/minor-fixes

A couple of minor fixes