Fixed some bugs and cleaner API
minor readbuffer update