Various patches and changes