Moved check for null terminator
Adding variable exportation
Fixed invalid mem read/writes