Changed implementation of integer to string conversion and memory management.