Multiple enhancements and bug fixes