small additions and bug fixes