Fixed free_ram, max_ram, used_ram

Long/int division resulted in unexpected values, making sure the value
is in the range of long fixes this problem.

TO DO: Fix used%ram