minor modifications, bug fixes