fixed some slight issues with charcodes