Fixed string bug, fixed memory issues