Fixes for various issues