[#120] Avoid integer overflow

* Cast values to long before the multiplication
* Clean up - no need to check if fs is null