Bug fixes for deployment