Minor enhacements and bug fixes