small changes and 1 or 2 bug fixes