Bugs related to str and bytes fixed