Some fixes for production use