some little but important bug fixes