fixed tests and minor enhancements