small improvements, bug fixes