Performance and functionality fixes