Fix some str/byte issues and splitting problems