Bug fixes for portal