minor bugfixes & readline support