Dynamically allocate memory

Squashed the same bug for get_number() and get_string(), although I don't think it actually was a problem in get_number()...
Whatever, it works, hell yeah