Fixes for multiple issues

This should fix all open issues