Fixed issue where all fields were added as strings
Fixed several bugs