Performance Improvements, minor fixes