Many little fixes and enhancements