Fixed io errors, added some features