Removed writeString(), fixed exceptions